package com.example.springboot.common;

import org.springframework.stereotype.Component;

/**
 * Description: 常量类
 *
 * @Author 马钰涵
 * @Create 2023/8/6 14:37
 * @Version 1.0
 */
@Component
public class Constants {

    //请求状态码和消息部分
    public static final String SUCCESS_CODE = "200";
    public static final String ERROR_CODE = "-1";
    public static final String SUCCESS_MSG = "success";
    public static final String ERROR_MSG = "error";

    //token请求码和消息部分
    public static final String TOKEN_ERROR_CODE = "401";
    public static final String TOKEN_IS_NULL = "无token，请重新登录";
    public static final String TOKEN_IS_ERROR = "token验证失败，请重新登录";

    //用户校验部分
    public static final String STATUS_DISABLE_CODE = "402";
    public static final String USER_IS_NOT_EXITS = "用户不存在，请重新登录";
    public static final String USER_IS_DISABLE = "当前用户已被禁用，请联系管理员";
    public static final String ADD_USER_ERROR = "添加用户失败";
    public static final String USER_IS_EXITS_CODE = "403";
    public static final String USER_IS_EXITS_MSG = "该用户已存在";

    //图书管理部分
    public static final String USER_IS_NOT_EXITS_MSG = "该用户不存在";
    public static final String BOOK_IS_NOT_EXITS_MSG = "该用户不存在";
    public static final String SCORE_IS_NOT_ENOUGH_MSG = "账户积分不够";
    public static final String BOOK_IS_NOT_ENOUGH_MSG = "图书已无库存";


    //密码保护部分
    public static final String SAIT_PASSWORD = "library";//盐
    public static final String DEFAULT_PASSWORD = "123456"; //新增管理员的默认密码
    public static final String UPDATE_PASSWORD_ERROR = "修改密码失败";

    //自定义异常部分
    public static final String SYSTEM_ERROR = "系统错误";
    public static final String SERVICE_EXCEPTION = "业务异常";
    public static final String USERNAME_OR_PASSWORD_ERROR = "用户名或密码错误";
}
